package com.lyc.controller;

import com.lyc.beans.Book;
import com.lyc.service.BookService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

@Controller
@RequestMapping("/load")
public class LoadController {
    @Autowired
    private BookService bookService;

    //加载书籍列表
    @RequestMapping("/bookInterface")
    @ResponseBody
    public Object bookInterface() {
        List<Book> books = bookService.getBooks();
        System.out.println(books);
        return books;
    }
}
